package playn.game.menu.states;

import playn.core.GroupLayer;
import playn.game.core.Button;
import playn.game.core.Game;
import playn.game.core.State;
import playn.game.menu.Menu;

public class Complete extends State {

	public final static String CONTINUE_BUTTON_ID="Continue";
	public final static String END_BUTTON_ID="EndGame";

	
	public Complete(GroupLayer layer) {
		super(layer);
		name="PAUSE";
		map=Game.maps.get("Complete.tmx");
	}

	
	
	
	@Override
	public void onPress(Button button){
		
		if(button.id().equalsIgnoreCase(CONTINUE_BUTTON_ID)){
			Game.level.start(2);
			Game.menu.switchTo(Menu.ACTION);
		} else if(button.id().equalsIgnoreCase(END_BUTTON_ID)){
			Game.action=false;
			transition.addOut(Game.level.layer);
			Game.menu.switchTo(Menu.START);
		}	
		else {
			super.onPress(button);
		}
	}
}
